{% extends 'airshow/base.html' %}

{% block title %}{% if area %}编辑区域{% else %}添加区域{% endif %} - 珠海航展数据管理系统{% endblock %}

{% block content %}
<div class="d-flex justify-content-between align-items-center mb-4">
    <h2>{% if area %}编辑区域{% else %}添加区域{% endif %}</h2>
</div>

<div class="card">
    <div class="card-header">
        <h5>区域信息</h5>
    </div>
    <div class="card-body">
        <form method="post">
            {% csrf_token %}
            <div class="mb-3">
                <label for="name" class="form-label">区域名称</label>
                <input type="text" class="form-control" id="name" name="name" value="{{ area.name|default:'' }}" required>
            </div>
            <div class="mb-3">
                <label for="location" class="form-label">位置</label>
                <textarea class="form-control" id="location" name="location" rows="3">{{ area.location|default:'' }}</textarea>
            </div>
            <div class="d-flex justify-content-between">
                <a href="{% url 'airshow:area_list' %}" class="btn btn-secondary">返回列表</a>
                <button type="submit" class="btn btn-primary">保存</button>
            </div>
        </form>
    </div>
</div>
{% endblock %} 